<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>

	</head>
	<style>
		.img {
			position: relative;
			border: solid 1px #000;
			display: inline-block;
			margin: 100px 100px
		}
		
		.img .marker {
			position: absolute;
			width: 20px;
			height: 20px;
			background: #f00;
		}
	</style>

	<body>
		<div class="img" id="dv">
			<img src="http://www.w3dev.cn/imgblog/20170506/1711113780.png"></div>
	</body>
	<script src="js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
	<script>
		function createMarker(x, y) {
			var div = document.createElement('div');
			div.className = 'marker';
			div.style.left = x + 'px';
			div.style.top = y + 'px';
			document.getElementById('dv').appendChild(div)
		}
		document.getElementById('dv').onclick = function(e) {
			e = e || window.event;
			var x = e.offsetX || e.layerX,
				y = e.offsetY || e.layerY;
			createMarker(x, y);
		}
	</script>

</html>